﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using ZLCMS.Data.Model;
using NHibernate;
using ZLCMS.Business;

namespace ZLCMS.Web.SystemManage.Basics.Log
{
    public partial class View : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!String.IsNullOrEmpty(Request["uid"]))
            {
                InitializeContent();
            }
        }

        protected void InitializeContent()
        {
            int id = Int32.Parse(Request["uid"]);

            using (ISession session = DotNet.Common.NHibernateUtil.SessionFactoryHelper.CreateSession())
            {
                SysLogInfo log = session.Get<SysLogInfo>(id);

                if (log != null)
                {
                    lblDate.Text = log.Date;
                    lblThread.Text = log.Thread;
                    lblLevel.Text = log.Level;
                    lblLogger.Text = log.Logger;
                    ltMessage.Value = log.Message;
                }
            }
        }
    }
}
